<?php

$spaceMessageStr = Yii::t('site', 'spaceMessage');
$manageMemberStr = Yii::t('site', 'manageMember');
$appStoreStr = Yii::t('site', 'appStore');
return array(
    'paths' => array(
        'basePath' => 'application.application.app.BSpaceEngine',
        'configPath' => 'config',
        'viewPath' => 'ui.themes.pc_bootstrap.views'
    ),
    'imports' => array(
        'classes' => 'classes',
        'uiPath' => 'ui',
        'screen' => 'ui.screens',
        'model' => 'ui.models',
        'operation' => 'operation',
        'operationFlow' => 'operationFlow',
    ),
    'metaFiles' => array(),
    'preLoad' => array(
        'app' => array(
            'BAppCommon' => array(
            )
        )
    ),
    'appMeta' => array(
        'appName' => 'SpaceEngine',
        'appClass' => 'BSpaceEngine',
        'description' => 'Space Engine',
        'relationship' => array(
            'space' => array(
//means current app is invisible in all appstore in all space
                BSpace::All => BRelationshipGroup::Space_App_Relationship . "." . BRelationship::app_invisible_in_appstore)),
        //'roles' => array(
        /*
          'admin' => array('testAdminRole'),
          'member' => array('testMemberRole' => array('testMemberRole2' => array('testMemberRole3'))),
          'customer' => array('testCustomerRole' => array('testCustomerRole2'))
         * 
         */
//),
        'ui' => array(
//'class'=>'', if not set class, use BUIApp
//'layoutView'=>array('name','data'),
            'views' => array(
                'appTopBar' => 'spaceEngineTopBar',
            //'appTopBar' => array('app_topBar'),
            ),
        /*
          'screen' => array(
          //'class'=>'', if defined class, use defined class for screen, otherwise, use BUIScreen
          //'layout'=>'', if not set layout, use default
          'views' => array(//define views show in layout
          'topBar' => array('spaceEngineTopBar') // format: viewName => array(viewFileName,viewData = null)
          )
          ),
         * 
         */
//'screenFlow'=>array()
        ),
        //operations defined here can get from app and can show in operation bar
        'operations' => array(
            'spaceMessage' => array(
//            $spaceMessageStr => array(
                'displayName' => 'Space Messages',
                //'class' => 'BOPSpaceMessage',
                'permit' => array(
                    BPermit::AllowAccess => BRole::All_Roles,
                ),
                'startScreen' => 'BScreenSpaceMessage',
                'messenger' => array(
                    'receiveMessages' => array(
                        'spaceIncomeMessage' => array(
                            //'message' => 'BMGSpaceMessage',
                            'receiver' => array(
                            //if ignoe, will use permit for operation
                            //'permit' => array('allowSendMessage' => BRole::All_Roles)                     
                            //if not specify circle or user, default is all user allow for operation
                            ),
                            'message_from' => array(
                            //if not specify space, use current space
                            //'space' => BMessage::Message_To_Current_Space,
                            //if not specify app, use current app
                            //'app' => BMessage::Message_To_Current_App,
                            //'operation' => 'applyJoinSpace'
                            )
                        )
                    ),
                    'sendMessages' => array(
                        'spaceOutMessage' => array(
                            //'message' => 'BMGSpaceMessage',
                            'sender' => array(
                            //if ignor, use operation permit
                            //'permit' => array('allowReceiveMessage' => BRole::All_Roles)
                            ),
                            'message_to' => array(
                            //if not specify space, use current space
                            //'space' => BMessage::Message_From_Current_App,
                            //if not specify app, use current app
                            //'app' => BMessage::Message_From_Current_App,
                            //'operation' => 'applyJoinSpace'
                            )
                        )
                    )
                )
            ),
//            $manageMemberStr => array(
            'manageMember' => array(
                'displayName' => 'Manage-Member',
                //'class' => 'BOPManageMember',
                'permit' => array(
                    'allowAccess' => BRole::Role_Space_Admin,
                ),
//                'startScreen' => 'BScreenRequestJoinSpace',
                'startScreen' => array(
                    'views' => array(
                        'manageMember' => 'manageMember')
                ),
                'messenger' => array(
                    'processJoinSpace' => array(
                        'allow_from' => array(
                            array(
                                'operation' => 'BPersonalApp:applyJoinSpace',
                                'message' => 'applyJoinSpace'
                            //'app' => BAddress::from_all_app,
                            //'operation' => BAddress::from_all_operation,
                            //'user' => BAddress::from_all_user
                            )
                        //if ignor, use operation permit
                        //'permit' => array('allowReceiveMessage' => BRole::All_Roles)
                        ),
                    //'allow_receiver' => array(
                    //if not specify space, use current space
                    //'space' => BMessage::Message_From_Current_App,
                    //if not specify app, use current app
                    //'app' => BMessage::Message_From_Current_App,
                    //'operation' => 'BPersonalApp:applyJoinSpace',
                    //'message' => 'applyJoinSpace'
                    //)
                    ),
                )
            ),
            'appStore' => array(
                'name' => 'appStore',
//            $appStoreStr => array(
//                'name' => $appStoreStr,
                'displayName' => 'App Store',
                'permit' => array(
                    'allowAccess' => BRole::Role_Space_Admin,
                ),
                'startScreen' => 'BScreenAppStore',
            ),
            'manageSpace' => array(
                'name' => 'manageSpace',
                'displayName' => 'Manage Space',
                'permit' => array(
                    'allowAccess' => BRole::Role_Space_Admin,
                ),
                'startScreen' => array('views' => array('manageSpace' => 'manageSpace')),
            ),
            'changePassword' => array(
                'name' => 'changePassword',
                'displayName' => 'Change Password',
                'permit' => array(
                    'allowAccess' => BRole::Role_Space_Admin,
                ),
                'startScreen' => array('views' => array('changePassword' => 'changePassword')),
            )
        )
    ),
    'db' => array(
        'connection' => array(
            'default' => 'blyndb',
            'localdb' => array(
                'connectString' => 'mysql:host=localhost;dbname=bilynapp',
                'user' => 'blndba',
                'password' => 'blnpwd'
            ),
            'blyndb' => array(
                'connectionString' => 'mysql:host=localhost;dbname=bilyn',
                'emulatePrepare' => true,
                'username' => 'test',
                'password' => 'password',
                'charset' => 'utf8',
                'tablePrefix' => 'tbl_',
                'enableParamLogging' => true,
            ),
        )
    ),
    //operationFlow defined here will show in operationflow bar
    'operationFlows' => array(),
);
?>
